% Test PCA classification and feature deduction
clear;close;

%generate data
mu1=[0,0];
sigma1=[1, 1.5;1.5, 3];
data1=mvnrnd(mu1, sigma1, 10);

mu2=[2, 8];
sigma2=[1.5, 0.3;0.3, 1];
data2=mvnrnd(mu2, sigma2, 10);

hold;
plot(data1(:,1), data1(:,2), 'c.');
%plot(data2(:,1), data2(:,2), 'b.');

%concatenate data
%data=[data1; data2];
data=[data1];

%PCA projection
[coeff, score, latent]=princomp(data);

%plot principle component
biplot(coeff, 'scores', score);
